package com.learning.netease.optimize.trx.dispatchservice.service;

import com.alibaba.fastjson.JSONObject;
import com.learning.netease.optimize.trx.dispatchservice.dao.DispatchDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * ClassName: DispatchService
 * Description:
 * Date: 2019/1/30 14:48 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class DispatchService {

    @Autowired
    private DispatchDao dispatchDao;


    /**
     * @param orderId
     */
    public void dispatch(String orderId) throws Exception {
        String dispatchId = "999999";
        JSONObject orderInfo = new JSONObject();
        orderInfo.put("dispatchId", dispatchId);
        orderInfo.put("orderId", orderId);
        orderInfo.put("dispatchStatus", "0000001");
        dispatchDao.save(orderInfo);
    }
}
